﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using DAL;
using BLL;
namespace Web.Admin
{
    public partial class Register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //获取用户名 密码
            //获取 用户输入的用户名密码
            string username = this.TextBox_username.Text;
            string pswd = this.TextBox_pswd.Text;
            string email = this.TextBox_email.Text;
            //创建 对象
            UserInfo user = new UserInfo();
            user.Username = username;
            user.Pswd = pswd;
            user.Email = email;
            //1
            user.Role = "user";
            bool ret = UserInfoBll.Register(user);
            if (ret)
            {
                Response.Redirect("/Login.aspx");
            }
        }
    }
}